#ifndef _INPUT_H
#define _INPUT_H

#include "Vector3D.h"

class CInput
{

public:

	//Constructor and destructor
	CInput();
	~CInput()		{}

	//Main function
	void		 	CheckInput();		//Get all the input data

	//Mouse movement
	Vector3D 		MousePos()					{ return mousepos; }	//get the mouse position
	Vector3D		MouseMoveVector()			{ return mousevector; }
	float			MouseMoveAngle()			{ return mouseangle; }
	float 			MouseMoveDistance()			{ return mousedistance; }
	bool 			MouseMoved()				{ return mousedistance; }

	//Key presses (includes mouse clicks)
	bool 			KeyState(unsigned char Key)	{ return keys[Key]; }	//Get the state of a specific key
	bool 			KeyDown(unsigned char Key)	{ return (!oldkeys[Key] && keys[Key]); }
	bool 			KeyUp(unsigned char Key)	{ return (oldkeys[Key] && !keys[Key]); }

private:

	bool oldkeys[256];			//Old state of all the keys
	bool keys[256];				//State of all the keys
	Vector3D mousepos;			//Position of the mouse
	Vector3D mouseoldpos;		//Old position of the mouse
	Vector3D mousevector;		//Vector of last mouse movement
	float mousedistance;		//Distance the mouse moved
	float mouseangle;			//Direction the mouse moved in

};

#endif //_INPUT_H 
